﻿using ShipborneDataTerminal.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace ShipborneDataTerminal.viewmodel
{
    public class PortsetModel : NotifyPropertyBase
    {
        private UIElement _portContent;

        public UIElement PortsetContent
        {
            get { return _portContent; }
            set
            {
                Set<UIElement>(ref _portContent, value);
            }
        }

        public CommandBase TabChangedCommand { get; set; }

        public PortsetModel()
        {

            TabChangedCommand = new CommandBase((o) =>
            {

                string[] strValues = o.ToString().Split('|');
                Assembly assembly = Assembly.LoadFrom(strValues[0]);
                Type type = assembly.GetType(strValues[1]);
                this.PortsetContent = (UIElement)Activator.CreateInstance(type);

            });
        }

    }
}
